
function sortNumber(a,b)
  {
    return a - b
  }
var arr = [10,5,6,7,6,10,1,3,5,54,0];
var stringArr = [10,5,6,7,6,10,1,3,5,54,0,'a','u','a','b','c','b'];
var stringArr1 = 'abcdaaqwe';
let abc = [...new Set(stringArr1)].join('');
console.log(arr.sort(sortNumber));
console.log('去重',abc,[...new Set(arr)],...new Set(stringArr1))
console.log(Array.isArray(arr),typeof arr,typeof Number('98'))
console.log(12345,Object.prototype.toString.call(arr) === "[object Array]");

// var arr1 = [1,2,3,4,[5,6,[7,8,[9,10,11]]]];
// function fillterArray(arr) {
//   let newArr = [];
//   for(let i = 0; i < arr.length; i++) {
//     if(Array.isArray(arr[i])) {
//       newArr = newArr.concat(fillterArray(arr[i]))
//     } else {
//       newArr.push(arr[i])
//     }
//   }
//   return newArr;
// }
// console.log(fillterArray(arr1));

// var heros=["李白",'蔡文姬','韩信','赵云','甄姬','阿珂','貂蝉','妲己'];
// console.log('222',heros.splice(1,3),heros);
let obj={
  name:"吴小明",
  age:24,
  love:{
      pingpang:true,
      arr:{
        arrname:true,
      }
  }
}
let arr3 = [1,2,3];
let arr4 = [8,9,10];
let obj1={...obj};
let obj2 = JSON.parse(JSON.stringify(obj));
obj.name="孙艺珍";
obj.age= 100;
obj.love.pingpang=false;
obj.love.arr.arrname=false;
let arr5 = [...arr3, ...arr4]
console.log(obj,{...obj}, arr5)
console.log(obj1)
console.log(obj2)

var x = 2;
function test() {
  this.x = 1;
  return 22
}

var obj5 = new test();
console.log('obj5---',obj5,x)

function test2() {
  return 'test2'
}
async function Funs() {
  console.log('Funs1');
  let a = await test2()
  console.log('Funs2',a);
  
}
console.log(Funs());

let str = {name:'小明',age:18}
let strs = JSON.stringify(str)
console.log(222,typeof strs);

console.log(111,JSON.parse(strs));
var q = undefined;

if (q) {
  console.log('you');
}else {
  console.log('meiyou');
  
}

let arrr = '123456';

arrr.substring(1)
console.log("🚀 ~ file: test2.js ~ line 89 ~ arrr", arrr)
let objss = {name:'qqq',age:18}

console.log("🚀 ~ file: test2.js ~ line 93 ~ objss",objss, JSON.stringify(objss))


function getStr(string,str){ 
  var str_before = string.split(str)[0]; 
  var str_after = string.split(str)[1]; 
  console.log('前：'+str_before+' - 后：'+str_after); 
} 
getStr('17/80', '/');


function Frandom(min, max)
{
    // 加一包含最大值  不加1不包含最大值
    return Math.floor(Math.random() * (max-min + 1)) + min;
}
console.log(Frandom(1,5)); 
console.log(Frandom(1,5)); 
console.log(Frandom(1,5)); 
console.log(Frandom(1,5)); 
console.log(Frandom(1,5)); 


let p = 'x'
p = p.repeat(5)
console.log("🚀 ~ file: test2.js ~ line 119 ~ p", p)


const data8 = { test1: 'abc', test2: 'cde' };
const arr8 = Object.values(data8);
const arr9 = Object.keys(data8);
console.log(arr8,1,arr9);

console.log(arr9,arr9.indexOf('test1'),'~',!~arr9.indexOf('test1'));
if (~arr9.indexOf('test2')) {
  console.log(arr9.indexOf('test2'),'找到',~arr9.indexOf('test2'));
}

if (~arr9.indexOf('test1')) {
  console.log(arr9.indexOf('test5'),'找到112',~arr9.indexOf('test5'));
}